package com.yanqu.road.entity.guess.data;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.Objects;

@FieldTypeAnnotation(tableName = "t_c_activity_common_guess_item", desc = "通用竞猜-竞猜选项")
public class CommonGuessItem extends DataObject {

    /**
     * 活动ID
     */
    private int activityId;

    /**
     * 分组ID
     */
    private int groupId;

    /**
     * 轮次
     */
    private int round;

    /**
     * 战场ID
     */
    private int siteId;

    /**
     * 竞猜对象的ID商会ID或玩家ID或其他
     */
    private String objId;

    /**
     * 竞猜玩家数量
     */
    private int guessUserNum;

    /**
     * 创建时间
     */
    private long createTime;

    public CommonGuessItem() {
    }

    public CommonGuessItem(int activityId, int groupId, int round, int siteId, String objId) {
        this.activityId = activityId;
        this.groupId = groupId;
        this.round = round;
        this.siteId = siteId;
        this.objId = objId;
        this.guessUserNum = 0;
        this.createTime = System.currentTimeMillis();
        setInsertOption();
    }

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }
    }

    public int getGroupId() {
        return groupId;
    }

    public void setGroupId(int groupId) {
        if (this.groupId != groupId) {
            this.groupId = groupId;
            setOp(DataStatus.Update);
        }
    }

    public int getRound() {
        return round;
    }

    public void setRound(int round) {
        if (this.round != round) {
            this.round = round;
            setOp(DataStatus.Update);
        }
    }

    public int getSiteId() {
        return siteId;
    }

    public void setSiteId(int siteId) {
        if (this.siteId != siteId) {
            this.siteId = siteId;
            setOp(DataStatus.Update);
        }
    }

    public String getObjId() {
        return objId;
    }

    public void setObjId(String objId) {
        if (!Objects.equals(this.objId, objId)) {
            this.objId = objId;
            setOp(DataStatus.Update);
        }
    }

    public int getGuessUserNum() {
        return guessUserNum;
    }

    public void setGuessUserNum(int guessUserNum) {
        if (this.guessUserNum != guessUserNum) {
            this.guessUserNum = guessUserNum;
            setOp(DataStatus.Update);
        }
    }

    public long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(long createTime) {
        if (this.createTime != createTime) {
            this.createTime = createTime;
            setOp(DataStatus.Update);
        }
    }
}
